package com.tl.boot.entity.permission.form;

import com.tl.boot.common.enums.ResultEnum;
import com.tl.boot.common.enums.StatusEnum;
import com.tl.boot.common.exception.BaseException;
import com.tl.boot.entity.demo.form.Base.BaseForm;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;


/**
 * com.tl.boot.entity.permission.form -- AddResourceInfoForm
 * Description:
 * Created by joshua_liu <a href="mailto:joshualwork@163.com"></a>
 * On 2019/9/19 14:39
 */
public class AddResourceInfoForm extends BaseForm {
    @ApiModelProperty(value = "资源代码",name = "resCode",example = "1001",dataType = "String")
    private String resCode;
    @ApiModelProperty(value = "资源名称",name = "resName",example = "添加用户",dataType = "String",required = true)
    private String resName;
    @ApiModelProperty(value = "资源类型",name = "resType",example = "系统资源",dataType = "String")
    private String resType;
    @ApiModelProperty(value = "资源url",name = "resUrl",example = "/user/add",dataType = "String",required = true)
    private String resUrl;
    @ApiModelProperty(value = "资源状态 VALID INVALID",name = "resStatusEnum",example = "VALID")
    private StatusEnum resStatusEnum;
    @ApiModelProperty(value = "资源内容",name = "resContent",example = "这是一个添加用户的系统资源",dataType = "String")
    private String resContent;
    @ApiModelProperty(value = "资源创建人",name = "createUser",example = "张胜男",dataType = "String")
    private String createUser;
    @ApiModelProperty(value = "资源所属系统编码",name = "belongSysno",example = "org1001",dataType = "String")
    private String belongSysno;
    @ApiModelProperty(value = "资源所属系统名称",name = "belongSysname",example = "河南工程信息部",dataType = "String")
    private String belongSysname;
    @ApiModelProperty(value = "备注",name = "remark",example = "备注信息",dataType = "String")
    private String remark;
    @ApiModelProperty(value = "扩展信息",name = "reserve",example = "扩展信息",dataType = "String")
    private String reserve;

    public String getResCode() {
        return resCode;
    }

    public void setResCode(String resCode) {
        this.resCode = resCode;
    }

    public String getResName() {
        return resName;
    }

    public void setResName(String resName) {
        this.resName = resName;
    }

    public String getResType() {
        return resType;
    }

    public void setResType(String resType) {
        this.resType = resType;
    }

    public String getResUrl() {
        return resUrl;
    }

    public void setResUrl(String resUrl) {
        this.resUrl = resUrl;
    }

    public StatusEnum getResStatusEnum() {
        return resStatusEnum;
    }

    public void setResStatusEnum(StatusEnum resStatusEnum) {
        this.resStatusEnum = resStatusEnum;
    }

    public String getResContent() {
        return resContent;
    }

    public void setResContent(String resContent) {
        this.resContent = resContent;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public String getBelongSysno() {
        return belongSysno;
    }

    public void setBelongSysno(String belongSysno) {
        this.belongSysno = belongSysno;
    }

    public String getBelongSysname() {
        return belongSysname;
    }

    public void setBelongSysname(String belongSysname) {
        this.belongSysname = belongSysname;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getReserve() {
        return reserve;
    }

    public void setReserve(String reserve) {
        this.reserve = reserve;
    }

    @Override
    public void checkParam() {
        if (StringUtils.isBlank(this.resName) || StringUtils.isBlank(this.resCode)) {
            throw new BaseException(ResultEnum.REQUEST_PARAM_ILLEGAL);
        }
    }
}
